package tx.oopa.circuit.node;

import java.util.ArrayList;
import java.util.List;


/**
 * Abstract class used by nodes which have edges, in other words which needs to send an update.
 * 
 * @author Xander van Rijn
 *
 */
public abstract class AbstractEdgingNode extends AbstractNode {

    public void addEdge(NodeObserver node) {
        this.addObserver(node);
    }
    
    public List<AbstractNode> getEdgingNodes() {
        List<AbstractNode> edges = new ArrayList<AbstractNode>(this.getObservers().size());
        for(NodeObserver node : this.getObservers()) {
            edges.add((AbstractNode)node);
        }
        return edges;
    }
}
